package com.example.administrator.hero.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2016/9/23.
 */
public class VpAdapter extends FragmentPagerAdapter {

    List<Fragment> mfragments = new ArrayList<>();
    String[] array= new String[]{"首页","咨询"};
    public VpAdapter(FragmentManager fm,List<Fragment> fragments) {
        super(fm);
        this.mfragments = fragments;
    }

    @Override
    public Fragment getItem(int position) {
        return mfragments.get(position);
    }

    @Override
    public int getCount() {
        return mfragments.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return array[position];
    }
}
